import request from "@/utils/request";


export function list(params){
    return request({
        url:'/user/selectAll',
        method:'get',
        params:params
    })
}



export function deleteUser(id){
    return request({
        url:'/user/delete/' + id,
        method:'delete',
    })
}


export function deleteBatch(ids){
    return request({
        url:'/user/batchDelete',
        method:'post',
        data:ids
    })
}

export function selectUserByUserId(id){
    return request({
        url:'/user/selectUserByUserId/' + id,
        method:'get'
    })
}

export function save(data){
    return request({
        url:'/user/save',
        method:'post',
        data:data
    })
}


export function edit(id,data){
    return request({
        url:'/user/edit/' + id,
        method:'post',
        data:data
    })
}

export function exp(){
    return request({
        url:'/user/export',
        method:'get',
        responseType:'blob'
    })
}

export function generateImportTemplate(){
    return request({
        url:'/user/generateImportTemplate',
        method:'get',
        responseType:'blob'
    })
}

export function importExcel(data){
    return request({
        url:'/user/import',
        method:'post',
        data:data
    })
}

export function updateAvatar(params){
    return request({
        url:'/user/updateAvatar',
        method:'get',
        params:params
    })
}

export function getUser(userName){
    return request({
        url:'/user/userName/'+userName,
        method:'get',
    })
}

export function updateUser(data){
    return request({
        url:'/user/updateUser',
        method:'post',
        data:data
    })
}

export function login(data){
    return request({
        url:'/user/login',
        method:'post',
        data:data
    })
}


export function logout(){
    return request({
        url:'/user/logout',
        method:'get',
    })
}




export function getCode(){
    return request({
        url:'/user/getCaptcha',
        method:'get',
    })
}

export function sendEmailCode(params){
    return request({
        url:'/user/sendEmailCode',
        method:'get',
        params:params
    })
}


export function updatePassword(params){
    return request({
        url:'/user/updatePassword',
        method:'get',
        params:params
    })
}



export function isEmailExist(params){
    return request({
        url:'/user/isEmailExist',
        method:'get',
        params:params
    })
}


export function verifyEmailCode(params){
    return request({
        url:'/user/verifyEmailCode',
        method:'get',
        params:params
    })
}


export function isPhonenumberExist(params){
    return request({
        url:'/user/isPhonenumberExist',
        method:'get',
        params:params
    })
}

export function isUsernameExist(params){
    return request({
        url:'/user/isUsernameExist',
        method:'get',
        params:params
    })
}

export function verifyUserEmail(params){
    return request({
        url:'/user/verifyUserEmail',
        method:'get',
        params:params
    })
}



export function register(data){
    return request({
        url:'/user/register',
        method:'post',
        data:data
    })
}
